<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<!-- header -->
		<title>${datebean.name}节点配置</title>
		<%@ include file="/WEB-INF/views/include/header.jsp"%>
		
	</head>
	<body class="no-skin">
		<!-- /section:basics/navbar.layout -->
		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<!-- /section:basics/sidebar -->
			<div class="main-content">
				<div class="main-content-inner">
					<div class="page-content">
						<!-- /section:settings.box -->
						<div class="row">
							<div class="col-xs-12">
								<div class="pull-right">
									<!-- 权限按钮拦截部分 -->
									   <%-- <button class="btn btn-sm btn-pink" id="import">导入</button>--%>
									
									<%--<shiro:hasPermission name="modules:sys:user:delete">
										<button class="btn btn-sm btn-danger" id="delete">删除</button>
									</shiro:hasPermission>
									<shiro:hasPermission name="modules:sys:user:excel">
										<button class="btn btn-sm btn-pink" id="export">导出</button>
									</shiro:hasPermission>--%>
									<!-- 权限按钮拦截部分 -->
								</div>
							</div>
						</div>
						<div class="row">
							<div class="col-xs-12">
								<!-- PAGE CONTENT BEGINS -->
									<!-- jqGrid表格 -->
									<table id="gridTable"></table>
									<!-- jqGrid工具类 -->
									<div id="gridPager"></div>
									<!-- 查询对话框 -->
									<div style="display: none;">
										<div class="row" id="queryDialog"></div>
									</div>
								<!-- PAGE CONTENT ENDS -->
							</div><!-- /.col -->
						</div><!-- /.row -->
					</div><!-- /.page-content -->
				</div>
			</div><!-- /.main-content -->

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
			</a>
			
			<!-- dialog -->
			<%@ include file="/WEB-INF/views/include/dialog.jsp"%>
		</div><!-- /.main-container -->
		
		<!-- footer -->
		<%@ include file="/WEB-INF/views/include/footer.jsp"%>
		
		<script type="text/javascript">
			//基本路径
			var proId='${proId }';
			var baseUrl = "<s:url value="/bnp/project/getProjectNodeScheduleData"></s:url>";
			//jqgrid的表格高度
			var height = 320;
			//jqgrid表格行头的中文
			var colNames = ['','节点ID','节点名称','责任单位','责任人','责任人电话','经办人','经办人电话','计划开始时间','计划结束时间','计划用时','实际开始时间','实际结束时间','实际用时','前置节点','操作'];
			//jqgrid表格中每一行的信息模型
			var colModel = [
				{name:'sysId', width:1, hidden: true,key:true},
				{name:'nodeId',index:'nodeId', width:30, editable: true},
				{name:'nodeName',index:'nodeName', width:40, editable: true},
				{name:'resDept',index:'resDept', width:40, editable: true},
				{name:'resUser',index:'resUser', width:40, editable: true},
				{name:'resUserPhone',index:'resUserPhone', width:40, editable: true},
				{name:'operatorUser',index:'operatorUser', width:40, editable: true},
				{name:'operatorPhone',index:'operatorPhone', width:40, editable: true},
				{name:'planBeginDate',index:'planBeginDate', width:40, editable: true},
				{name:'planFinishDate',index:'planFinishDate', width:40, editable: true},
				{name:'planTime',index:'planTime', width:20, editable: true},
				{name:'factBeginDate',index:'factBeginDate', width:40, editable: true},
				{name:'factFinishDate',index:'factFinishDate', width:40, editable: true},
				{name:'factTime',index:'factTime', width:20, editable: true},
				{name:'preNodeId',index:'preNodeId', width:10, editable: true},
				{name:'sysId',index:'sysId', width:40, editable: true,
					formatter:function(value, grid, rows, state) {
						return "<a onclick=setModel('"+rows.sysId+"','"+proId+"')>配置节点信息</a>";
				}},
			];
			//jqgrid的具体执行方法
			jqgrid({
				gridTableId : "#gridTable",
				gridPagerId : "#gridPager",
				postData: {proId : proId},
				mtype: 'get'
			});
			
			function setModel(obj,proId){
				$("#queryDialog").empty();
				$("#queryDialog").load('<s:url value="/bnp/project"></s:url>/setResUserView?proId='+proId+'&sysId='+obj);
				var queryDialog = $("#queryDialog");
				showDialog({
					dialogTitle: '设置',
					dialogBody: queryDialog,
					dialogFoot: ""
				});
				
			}
			
		</script>
	</body>
</html>